package com.example.controller;

import com.example.entity.MailRequest;
import com.example.mail.MailClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mail")
@Api("邮件相关服务")
public class MailController {

    @Autowired
    private MailClient mailClient;

    @ApiOperation("发送邮件")
    @PostMapping("/send")
    public void send(@RequestBody MailRequest mailTextVO) {
        mailClient.send(mailTextVO);
    }
}
